<?php

Raise::load('core.RaiseStaticClass');

/**
 * RaiseLastError class
 * Helper for fetching PHP errors
 *
 * @author Sam-Mauris Yong / hellclanner at live dot com
 * @license http://www.opensource.org/licenses/bsd-license New BSD License
 * @package phpraise.core.exception
 * @since 1.2
 */
class RaiseLastError extends RaiseStaticClass {
    
    /**
     * Fetch the last error message occurred
     * @return string
     * @static
     */
    public static function error(){
        $lastError = error_get_last();
        if($lastError == null){
            return '';
        }else{
            return $lastError['message'];
        }
    }
    
}